
cmake_minimum_required(VERSION 3.0)

project(test)

#将 gtest 添加到选项中
#关闭gmock功能
set(BUILD_GMOCK OFF)
#将gtest添加到项目
add_subdirectory(${PROJECT_ROOT}/thirdpart/googletest-1.14.0 googletest)

add_executable(test_list ${CMAKE_CURRENT_SOURCE_DIR}/test_list.cpp ${PROJECT_ROOT}/custom_function/function.cpp)

#测试框架需要头文件
target_include_directories(test_list PUBLIC ${PROJECT_ROOT}/thirdpart/googletest-1.14.0/googletest/include)

#测试hello模块需要路径
target_include_directories(test_list PUBLIC ${PROJECT_ROOT})
#依赖库
target_link_libraries(test_list gtest gtest_main)

add_test(NAME test_list 
COMMAND test_list)